
package com.tenentia.pcmps.swm.web.jsf.beans;

import org.apache.log4j.Logger;
import org.richfaces.component.html.HtmlDatascroller;

import com.tenentia.pcmps.swm.Constants;
import com.tenentia.pcmps.swm.web.jsf.tables.JSFTableDataModel;
import com.tenentia.pcmps.swm.web.jsf.tables.JSFTableDataProvider;
import com.tenentia.pcmps.swm.web.jsf.tables.implementation.GroupsTableDataProvider;

/**
 * 
 * @author tEnEntia, S.L.N.E.
 * 
 */
public class GroupsManagement {

	private static final Logger LOGGER = Logger.getLogger(GroupsManagement.class.getPackage().getName());

	private JSFTableDataModel tableDataModel;

	private HtmlDatascroller tableDataScroller;

	public GroupsManagement() {

		super();
	}

	public String prepareView() {

		LOGGER.debug(Constants.STRING_L4J_METHOD_BEGIN);

		JSFTableDataProvider tableDataProvider = new GroupsTableDataProvider();
		tableDataModel = new JSFTableDataModel(tableDataProvider);

		tableDataScroller = new HtmlDatascroller();
		tableDataScroller.setPage(1);

		return Constants.STRING_JSF_ACTION_SUCCESS;
	}

	/**
	 * @return the tableDataModel
	 */
	public JSFTableDataModel getTableDataModel() {

		return tableDataModel;
	}

	/**
	 * @return the tableDataScroller
	 */
	public HtmlDatascroller getTableDataScroller() {

		return tableDataScroller;
	}

	/**
	 * @param tableDataModel
	 *            the tableDataModel to set
	 */
	public void setTableDataModel(JSFTableDataModel tableDataModel) {

		this.tableDataModel = tableDataModel;
	}

	/**
	 * @param tableDataScroller
	 *            the tableDataScroller to set
	 */
	public void setTableDataScroller(HtmlDatascroller tableDataScroller) {

		this.tableDataScroller = tableDataScroller;
	}

}
